On a terminal screen, an application program generally displays content for a user in a form of a window, that is, an image that the user sees by using the terminal screen. When multiple application programs all need to display content on the terminal screen, an image displayed on the terminal screen is generally obtained after multiple windows displayed by the multiple application programs are overlapped and synthesized. If the user enables an application program, the application program presents a window on the terminal screen and displays content in the window. In this case, if an alarm box of another application program pops up on the terminal screen, the alarm box generally covers a part of the content in the window of the application program, and a result eventually displayed on the terminal screen is an image displayed after the window displayed by the application program and a window displaying the alarm box are overlapped.
To implement synthesized display of content corresponding to multiple windows, an available method is to make each window correspond to one layer in a memory. An image is actually drawn in the memory, and an image in each layer indicates content that needs to be displayed in a window. If a window covers a part of another window, a value of a pixel eventually displayed on a terminal screen is implemented by adding up, according to a required proportion, values of pixels that are of the two layers in the memory and that are at a same screen location, and content eventually displayed in the multiple windows is obtained by adding up layer-by-layer, according to a corresponding proportion, pixel values of a part mutually covered by multiple layers.
In the prior art, images of multiple layers are synthesized in an off-line mode. In the off-line mode, a layer that needs to be displayed is pre-read before being displayed, a pixel value of each point on a terminal screen is obtained by calculation and written into a memory. When the layer needs to be displayed, specific content is read from the memory into which the pixel value is written, and the specific content is displayed on the terminal screen. Therefore, pixel value calculation can be performed only after all layers are completely read. Consequently, a moment for calculating the pixel value and a moment for displaying the pixel value cannot keep synchronous. When there are many image frames that need to be displayed, a relatively long period of time is needed to wait for complete read-in of the layers, and relatively much time is needed to calculate the pixel values, which reduces image synthesis efficiency, and cannot meet a requirement of a current application program.